//
//  UIButton+GYExtension.m
//  GoodLuck
//
//  Created by apple on 2018/2/6.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//

#import "UIButton+GYExtension.h"

@implementation UIButton (GYExtension)

+  (instancetype)buttonWithFrame:(CGRect)frame title:(NSString *)title backgroundColor:(UIColor *)backgroundColor fontSize:(CGFloat)font tag:(NSInteger)tag target:(id)target action:(SEL)action {
    
    UIButton *btu = [[UIButton alloc] initWithFrame:frame];
    btu.tag = tag;
    [btu setBackgroundColor:backgroundColor];
    [btu setTitle:title forState:UIControlStateNormal];
    [btu setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btu.titleLabel.font = [UIFont systemFontOfSize:font];
    [btu addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    
    return btu;
}
@end
